package com.cbw.bean;
import java.io.Serializable;
import java.util.Objects;
public class Book implements Serializable {
    private static final long serialVersionUID = 3497715600718471901L;
    //必须有序列化id
    //排序的方式： 价格（升降） 新旧（出版时间）
    private String bookName;//书名;
    private double bookPrice;//价格
    private String bookPublishDate;//出版时间

    @Override
    public String toString() {
        return "Book{" +
                "bookName='" + bookName + '\'' +
                ", bookPrice=" + bookPrice +
                ", bookPublishDate='" + bookPublishDate + '\'' +
                '}';
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public double getBookPrice() {
        return bookPrice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Book book = (Book) o;
        return Objects.equals(bookName, book.bookName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bookName);
    }

    public void setBookPrice(double bookPrice) {
        this.bookPrice = bookPrice;
    }

    public String getBookPublishDate() {
        return bookPublishDate;
    }

    public void setBookPublishDate(String bookPublishDate) {
        this.bookPublishDate = bookPublishDate;
    }

    public Book(String bookName, double bookPrice, String bookPublishDate) {
        this.bookName = bookName;
        this.bookPrice = bookPrice;
        this.bookPublishDate = bookPublishDate;
    }
}